package ddb.tasktracker.intf.context.dto;

public class ContextStatus {

	public final static int WORKING = 0;
	public final static int SHUTTING_DOWN = 1;
	public final static int ERROR = 2;

	public static String toString(int contextStatus) {
		switch (contextStatus) {
		case WORKING:
			return "Working";
		case SHUTTING_DOWN:
			return "Shutting down";
		case ERROR:
			return "Error";
		}
		return null;
	}

	public static int valueOf(String status) {
		switch (status) {
		case "WORKING":
		case "Working":
			return WORKING;
		case "SHUTTING_DOWN":
		case "Shutting down":
		case "ShuttingDown":
			return SHUTTING_DOWN;
		case "ERROR":
		case "Error":
			return ERROR;
		}
		return WORKING;
	}
}
